#include <traceUtils/array.idc>
class ForRunToAddr{
    ForRunToAddr(){
        this.segmentName = Array(AR_STR, "segmentName");
        this.forStartAddr = Array(AR_LONG, "forStartAddr");
        this.forEndAddr = Array(AR_LONG, "forEndAddr");
    }

    ~ForRunToAddr(){}

    add(segmentNameParam, startAddr, endAddr){
        this.segmentName.add(segmentNameParam);
        this.forStartAddr.add(startAddr);
        this.forEndAddr.add(endAddr);
    }

    getForStartAddrIndex(startAddr){
        return this.forStartAddr.contain(startAddr);
    }

    getSegmentNameByIndex(index){
        return this.segmentName.get(index);
    }

    getForEndAddrByIndex(index){
        return this.forEndAddr.get(index);
    }

    forEcho(){
        auto i;
        Message("len: %d\n", this.segmentName.len);
        for(i = 0; i < this.segmentName.len; i = i + 1){
            Message("segmentName: %s, forStartAddr: 0x%x, forEndAddr: 0x%x \n", this.segmentName.get(i), this.forStartAddr.get(i), this.forEndAddr.get(i));
        }
        Message("\n");
    }
}